﻿@using Lavka.Models
@using(Html.BeginForm("Find", "Search", FormMethod.Post))
{
    <table style="margin: 10px;">
    <tr>
        <td style="padding: 3px; color: #474322; font-size: 12px;">Бренд:</td>
        <td style="padding: 3px;">
            @{
                var context = new LavkaDbEntities();
                var list = new List<SelectListItem>();
                var all = new SelectListItem();
                all.Selected = true;
                all.Text = "Все производители";
                all.Value = "-1";
                list.Add(all);
                list.AddRange(new SelectList(context.Brands.ToList(), "BrandId", "Name").ToList());
            }
            <select id="ddlBrands" style="width: 100%; margin: 0px;">
            @*@Html.Dro|pDownList("ddlBrands", (IEnumerable<SelectListItem>)ViewData["Brands"])*@
            @foreach (var item in list)
            {
                <option value="@item.Value">@item.Text</option>
            }
            </select>
            <input type="hidden" id="BrandId" name="BrandId"/>
        </td>
    </tr>
    <tr>
        <td style="padding: 3px; color: #474322; font-size: 12px;">Название:</td>
        <td style="padding: 3px;"><input id="SearchName" name="SearchName" type="text" /></td>
    </tr>
    <tr>
        <td style="padding: 3px; color: #474322; font-size: 12px;">Артикул:</td>
        <td style="padding: 3px;"><input id="SearchReference" name="SearchReference" type="text" /></td>
    </tr>
    <tr>
        <td style="padding: 3px; color: #474322; font-size: 12px;">Цена:</td>
        <td style="padding: 3px; font-size: 12px; color: #474322;">от <input id="PriceFrom" type="text" name="PriceFrom" style="width: 40px;" /> до <input id="PriceTo" name="PriceTo" type="text" style="width: 40px;" /></td>
    </tr>
    <tr>
        <td colspan="2" style="padding: 3px;color: #474322; font-size: 12px;"><input id="cbSets" name="cbSets" type="checkbox" value="Только наборы" title="" />Только наборы</td>
    </tr>
    <tr>
        <td style="text-align: center;" colspan="2">
            <input type="submit" value="Поиск" class="button"/>
        </td>
    </tr>
    </table> 
}

